package com.itshidu.jiaowu.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itshidu.jiaowu.entity.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author XiaZengming123
 * @since 2019-07-08
 */
@Mapper
public interface StudentMapper extends BaseMapper<Student> {
    @Insert("insert into student(id,college_level,college_name,graduate_date,join_date,score,parent_info,status) value (?,?,?,?,?,?,?,?) ")
    void save(Student student);

    @Select("select * from student a where a.classid=#{classesid}")
    List<Student> SelectAllByClassName(Long classesid);

    @Update("update student set classid =#{clasid} where id =#{id}")
    void updateByClassid(Long id,Long clasid);

    @Select("Select * from student where id=#{id}")
    Student SelectById(Long id);
}
